home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir26
/
epi601_3.zip
/
FILES11.EXE
/
TIME.PGM
< prev
next >
Wrap
Text File
|
1994-08-22
|
9KB
|
245 lines
*=============================== TIME.PGM ===================================
* Surveillance Information System Demo: updating time data ...
*
* Epi Info program that reads communicable disease surveillance files,
* produces disease specific aggregated files for use in graphic package.
* It outputs ASCII comma delimited files that can be retrieved in any
* graphic software such as Harvard graphics (DOS 2,3, or Windows) or
* Freelance graphics, using templates.
*
* READS : SUMXX .REC x (YEARBACK + 1)
* USES :
* PRODUCES : XXXXX .DAT
*
* LAST UPDATE 06/06/94 Denis Coulombier
*
*============================================================================
*============================== Initialization section ======================
SET IGNORE=OFF SPLIT=OFF NOECHO=ON COLOR = 31 30 112
CLS
*-------------------- Global variables declarations ---------------------
DEFINE HGVERSION # GLOB 3
* HGVERSION corresponds to the Harvard Graphic version used. 2 for 2.x
* and 3 for version 3. Both version treat differently ASCII data
* when importing.
DEFINE CURYEAR ## GLOB
IMMEDIATE CURYEAR = SYSTEMDATE[7,2]
* The current year defaults to the system year. You can change this by
* commenting out last line and changing the declaration
* of this year as follows: DEFINE CURYEAR ## GLOB 93
DEFINE CURDIS ____________________ GLOB
* Hold the name of the current disease for updating title in HG3
DEFINE DUMYEAR ## GLOB @CURYEAR
DEFINE YEARBACK # GLOB 4
* YEARBACK specifies the additional number of years you want to consider for
* building historical trends. If YEARBACK = 3, then 4 summary files will be
* open since it requires four files to have the past 156 weeks (3 years)
DEFINE FILES STRING WIDTH=50 GLOB "SUM@CURYEAR "
* Holds the name of the summary files to open
DEFINE COUNTER ## GLOB
DEFINE CUREVENT ##### GLOB
* Disease under consideration
DEFINE LASTWEEK ## GLOB
* last week of the current year
*-------------------- Checks last week of CURYEAR ---------------------------
READ SUM@CURYEAR
IF MMWRWK > COUNTER THEN COUNTER = MMWRWK
* Checks the latest MMWR week entered and loads it into LASTWEEK
GOTO PROG_SCR
ECHO
ECHO Current dataset: SUM@CURYEAR
ECHO
ECHO Calculating the last MMWRWK entered in 19@THISYEAR
ECHO
ECHO
SET NOECHO=ON
PROCESS
CLS
SET NOECHO=ON
IMMEDIATE LASTWEEK = COUNTER
*-------------------- Determines files to be opened ---------------------------
IMMEDIATE COUNTER = YEARBACK
:LOOPFILE
IMMEDIATE DUMYEAR = DUMYEAR - 1
IMMEDIATE COUNTER = COUNTER - 1
IMMEDIATE FILES = FILES + "SUM@DUMYEAR "
IMMEDIATE IF COUNTER > 0 THEN \
GOTO LOOPFILE
* This loop decrement the year YEARBACK times, and append the name of the
* file to FILES which will be READ later
*===========================End Initialization section ======================
*============================ Main Program section ===========================
* This main program section contains code for selecting disease, and then
* calls a sub routine to process the file.
*
* This "structured" approach allows easy maintenance of the code since
* only one copy of the code for any specific disease is necessary
*
* The only thing necessary to add a disease in the list are the 2 statements
* IMMEDIATE CUREVENT=XXXXX
* GOTO PROC_DISEAS
* Customized to the disease code of interest
*--- Salmonellosis ---
IMMEDIATE CUREVENT=11000
GOTO PROC_DISEAS
*--- Gonorrhea ---
IMMEDIATE CUREVENT=10280
GOTO PROC_DISEAS
*--- Hepatitis B ---
IMMEDIATE CUREVENT=10100
GOTO PROC_DISEAS
*--- Measles ---
IMMEDIATE CUREVENT=10500
GOTO PROC_DISEAS
*--- Hemophilus Influenzae ---
IMMEDIATE CUREVENT=10590
GOTO PROC_DISEAS
* Clean up and QUIT
RUN CONFIG.EPI
READ STATUS
IF REPORTCODE = 4 THEN UPDATEDATE = SYSTEMDATE
IF REPORTCODE = 4 THEN UPDATETIME = SYSTEMTIME
ERASE ~.REC
ROUTE ~.REC
WRITE RECFILE REPORTNAME REPORTCODE UPDATEDATE UPDATETIME
ROUTE SCREEN
READ ~.REC
ERASE STATUS.REC
CLOSE ~.REC
RENAME ~.REC STATUS.REC
ERASE ~.REC
QUIT
*=========================End Main Program section ===========================
*========================= Sub routine: PROC_DISEAS ==========================
* This section creates a summary file with PLACE and PERSON specific
* information, aggregated by TIME characteristics.
* The file generated will be used by GRAPHIC software to display data
* This example uses salmonellosis notification (EVENT=11000)
* Any disease can be added by copying the disease specific section
* and changing the IMMEDIATE CUREVENT statement
*------------------------- Data section -------------------------------------
:PROC_DISEAS
READ @FILES
DEFINE SERIE ###
* Serial holds the week number of the past YEARBACK*52 weeks
SERIE = MMWRWK - LASTWEEK + ((YEARBACK - (CURYEAR - YEAR)) * 52)
* Numbers the week from 1 to YEABACK * 52, corresponding to the
* last YEARBACK number of years of data
SELECT SERIE > 0 AND <= (YEARBACK * 52)
SELECT EVENT = CUREVENT
** SELECT any optional PLACE characteristics such as county
*------------------------- Process section ----------------------------------
ERASE ~.REC
ROUTE ~.REC
GOTO PROG_SCR
ECHO
ECHO Routing output to a temporary file ~.REC
ECHO
ECHO Current dataset: @FILES
ECHO Current event: @CUREVENT
ECHO Current Week: @LASTWEEK
ECHO Current year: 19@CURYEAR
ECHO
SET NOECHO=ON
OUTPUT SUMFREQ COUNT SERIE
SET NOECHO=ON
CLS
* 2nd level of aggregation, by week number, in a temporary file
READ DISEASES
IF EVENT = CUREVENT THEN CURDIS = DISEASE
PROCESS
ERASE @CUREVENT.DAT
ROUTE @CUREVENT.DAT
IMMEDIATE IF HGVERSION = 2 THEN TYPE ",Up to Week # @LASTWEEK of 19@CURYEAR"
IMMEDIATE IF HGVERSION = 3 THEN \
TYPE "Notifications of @CURDIS\nState of Michigan, as of Week # @LASTWEEK, 19@CURYEAR"
* In Harvard graphics 2.x, the first record of an ASCII comma delimited
* file may be used to update the legend. In Harvard 3, every attributes of
* the graph may be updated from an ASCII file, including the title,
* axis title. If you use HG3, you can add as many TYPE statement as you
* wish. You will have to customize the link in the IMPORT ASCII DELIMITED
* feature of HG3
READ WEEK.REC
RELATE SERIE ~.REC
* WEEK.REC file has only one variable, SERIE, taking values from 1 to 400
* By relating from this file to the file newly aggregated, we ensure
* that all weeks are represented whether or not cases were notified.
* OUTPUT SUMFREQ does not produce one record for weeks not represented in
* the data file. These missing weeks are recoded from missing to 0
* (RECODE COUNT .=0)
SELECT SERIE > 0 AND <= (YEARBACK * 52)
RECODE COUNT .=0
GOTO PROG_SCR
ECHO
IMMEDIATE IF HGVERSION = 2 THEN \
ECHO Routing output in ASCII format for Harvard Graphics 2.x ELSE \
ECHO Routing output in ASCII format for Harvard Graphics 3.x
ECHO
ECHO Current dataset: @FILES
ECHO Current event: @CUREVENT
ECHO Current Week: @CURWEEK
ECHO Current year: 19@CURYEAR
ECHO
SET NOECHO=ON
WRITE SERIE,",",COUNT
SET NOECHO=ON
CLS
* Output 2 series in the .DAT file, separated by a comma
* 1, 12
* 2, 4
* 3, 8
* .....
ROUTE SCREEN
RETURN
*======================End Sub routine: PROC_DISEAS ==========================
*========================= Sub routine: PROG_SCR =============================
:PROG_SCR
CLS
SET NOECHO=OFF
ECHO ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓╔════════════════════════════════════════════════════════════════╗▓▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ N E T S S R E P O R T S ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓╠════════════════════════════════════════════════════════════════╣░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ » Please be patient ........ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ » Running report TIME.PGM ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓║ ║░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓╚════════════════════════════════════════════════════════════════╝░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓
ECHO ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
ECHO ═══════════════════════════════════════════════════════════════════════════════
RETURN
*====================== End Sub routine: PROC_DISEAS ==========================